Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

632693 Views

Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/114 - Weight Converter

style.css cody/swapnilsparsh/30DaysOfJavaScript/114 - Weight Converter/style.css
90 Views
0 Comments
html{
height: 100%;
}
body{
background: linear-gradient(to right, #8f2d7b, #8894a2);
color: white;
font-family: Arial, Helvetica, sans-serif;
}
index.html cody/swapnilsparsh/30DaysOfJavaScript/114 - Weight Converter/index.html
281 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weight Converter🎱</title>
<link rel="stylesheet" href="style.css">
readme.md cody/swapnilsparsh/30DaysOfJavaScript/114 - Weight Converter/readme.md
171 Views
0 Comments
# Weight Converter 🎱 :
---
It's a simple Weight Converter which takes weight as 'grams' and convert into -> 'pound' , 'kg' , 'Ounces' , 'Stones'.

---

## Tech stack Used:
HTML5, CSS3, JavaScript
script.js cody/swapnilsparsh/30DaysOfJavaScript/114 - Weight Converter/script.js
150 Views
0 Comments
let button = document.getElementById('btn');

button.addEventListener('click', function(){
const gram = parseInt(document.getElementById('grams').value);
const type = document.getElementById('type').value;

if(gram === '' || isNaN(gram)){
document.getElementById('grams').focus();